package com.puppet.config;

import org.springframework.amqp.core.Queue;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/*
* 消息队列配置
* */
@Configuration
public class RabbitConfig {
    /*
    * 创建一个邮件队列
    * */
    @Bean
    public Queue emailQueue(){
        return new Queue("email.queue");
    }
    /*
    * 消息序列化成JSON字符串
    * */
    @Bean
    public MessageConverter messageConverter(){
        return new Jackson2JsonMessageConverter();
    }
}
